#ifndef IMAGEENHANCEDIALOG_H
#define IMAGEENHANCEDIALOG_H

#include <QDialog>
#include <QSlider>
#include <QSpinBox>
#include <QCheckBox>
#include <QComboBox>
#include <QLabel>
#include <QPushButton>
#include "enhanceparams.h"
#include "zoomablepreview.h"

class ImageProcessor;  // 前向声明

class ImageEnhanceDialog : public QDialog
{
    Q_OBJECT

public:
    explicit ImageEnhanceDialog(const QImage& originalImage, QWidget *parent = nullptr);
    EnhanceParams getParameters() const;
    QAbstractButton* clickedButton() const { return m_clickedButton; }

signals:
    void previewRequested(const EnhanceParams& params);

private slots:
    void updatePreview();
    void resetParameters();
    void applyPreset(const QString& presetName);

private:
    void setupUI();
    void createConnections();

    QImage m_originalImage;
    ZoomablePreview* m_previewView;
    QSlider *m_brightnessSlider;
    QSlider *m_contrastSlider;
    QSlider *m_sharpnessSlider;
    QCheckBox *m_denoiseCheck;
    QCheckBox *m_autoRotateCheck;
    QComboBox *m_colorModeCombo;
    QComboBox *m_presetCombo;
    QPushButton *m_resetButton;
    QPushButton *m_applyButton;
    QPushButton *m_applyAllButton;
    QPushButton *m_cancelButton;
    QAbstractButton* m_clickedButton = nullptr;
    QImage m_previewImage;
    ImageProcessor* m_imageProcessor;
};

#endif // IMAGEENHANCEDIALOG_H 